<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<% String path=request.getContextPath(); String basePath=request.getScheme()+ "://" + request.getServerName() + ":" + request.getServerPort() + path+ "/"; %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html  xmlns="http://www.w3.org/1999/xhtml"> 
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<base href="<%=basePath%>">
<title>合作伙伴需求配置列表</title>
<%@ include file="/WEB-INF/jsp/common/common.jsp" %>
<script src="js/jquery.divbox.js" type="text/javascript"></script>
	<style>
		/* .scroll_box {
			width:100%;
			overflow: scroll;
		}
		.scroll_table {
			width: 150%;
		} */
		.input_button_1,
		.input_button_2{
			margin-right: 10px;
		}
		.h_30 {
			height: 30px;
			line-height: 30px;
		}
		.table_body_div {
			padding: 30px;
		}
		.table_body_title {
			font-weight: bold;
			font-size: 16px;
		}
		.fr {
			float: right;
		}
		.fl {
			float: left;
		}
		.depts {
			padding-top: 10px;
		}
		/* 清除浮动 */
		.depts::after {
			clear:both;
			content:'.';
			display:block;
			width: 0;
			height: 0;
			visibility:hidden;
		}/*==for FF/chrome/opera/IE8==*/
		.depts li {
			width: 25%;
			float: left;
			line-height: 30px;
			height: 30px;
		}
		.depts li input {
			margin-right: 5px;
		}
		#areaDiv {
			padding-bottom: 20px;
		}
		
		
		
 #channel_code {
            position: relative;
            width: 127.5px;
            height: 200px;
            border: 2px solid #66afe9;
            border-top: 0px;
            overflow: auto;
            display: none;
            margin-left: -1px
        }
 #channel_version {
            position: relative;
            width: 127.5px;
            height: 200px;
            border: 2px solid #66afe9;
            border-top: 0px;
            overflow: auto;
            display: none;
            margin-left: -1px;
        }
#demand_number{
            position: relative;
            width: 127.5px;
            height: 200px;
            border: 2px solid #66afe9;
            border-top: 0px;
            overflow: auto;
            display: none;
            margin-left: -1px;
        }
 #demand_name {
            position: relative;
            width: 280px;
            height: 200px;
            border: 2px solid #66afe9;
            border-top: 0px;
            overflow: auto;
            display: none;
            margin-left: -1px
        }


	</style>
	<script type="text/javascript">
	/*----------- 初始化 ------------------- */
 	function init() {
 		queryChannelInfo('1')
	}
	var list = new Array();
	list= JSON.parse("${infos}");    
	$(function() {
		init()
    	//隐藏列表框
	    $("body").click(function () {
	        $("#channel_code").css('display', 'none');
	        $("#channel_version").css('display', 'none');
	        $("#demand_name").css('display', 'none');
	        $("#demand_number").css('display', 'none');
	    });
	  //合作伙伴代码模糊匹配1.5秒延迟
		var channelCodeTimer = null;
		$("#channelCode").keyup(function(){
			var jsonDate;
			var channelCode = $("#channelCode").val();
				jsonDate={channelCode:channelCode};
				clearTimeout(channelCodeTimer);
				if(channelCode!="" && channelCode.length>1){
					channelCodeTimer = setTimeout(function(){
						$.ajax({
							url : "<%=path%>/channelManage/ajaxSelectChannelCode",
							type : 'POST',
							async : true,
							dataType:'json',
							data:jsonDate,
							success : function(data) {
								$("#channel_code").html("");
								var str = "<ul style='width: 130px; height: 200px;'>";
								for (var i=0;i<data.length;i++){
									str+="<li class='div_item' onclick = 'indexChannelCodeVal(this)' style='background-color: white;text-align: center;cursor: pointer;'>"+data[i].channelCode+"</li>"
								}
								str+="</ul>"
								$("#channel_code").append(str)
								$("#channel_code").css('display', 'block');
								//绑定鼠标移出移出效果
							    $(".div_item").hover(function () {
							        $(this).css('background-color', '#1C86EE').css('color', 'white');
							    }, function () {
							        $(this).css('background-color', 'white').css('color', 'black');
							    });
							}
							
						});
					}, 1000);
				}else{
					$("#channel_code").css('display', 'none');
				}
		});
		//版本日期模糊匹配1.5延迟
		var channelVersionTimer = null;
		$("#channelversion").keyup(function(){
			var jsonDate;
			var versionNo = $("#channelversion").val();
				jsonDate={versionNo:versionNo};
				clearTimeout(channelVersionTimer);
				if(versionNo!="" && versionNo.length>1){
					channelVersionTimer = setTimeout(function(){
						$.ajax({
							url : "<%=path%>/channelManage/ajaxSelectChannelVersion",
							type : 'POST',
							async : true,
							dataType:'json',
							data:jsonDate,
							success : function(data) {
								$("#channel_version").html("");
								var str = "<ul style='width: 130px; height: 200px;' id='versionLis'>"
								for (var i=0;i<data.length;i++){
									str+="<li class='version'onclick = 'indexChannelVersionVal(this)'  style='background-color: white;width: 100%;height: 20px;font-size: 13px;line-height: 20px;text-align: center;cursor: pointer;'>"+data[i].channelVersion+"</li>"
								}
								str+="</ul>"
								$("#channel_version").append(str)
								$("#channel_version").css('display', 'block');
								//绑定鼠标移出移出效果
							    $(".version").hover(function () {
							        $(this).css('background-color', '#1C86EE').css('color', 'white');
							    }, function () {
							        $(this).css('background-color', 'white').css('color', 'black');
							    });
							}
							
						});
					}, 1000);
				}else{
					$("#channel_version").css('display', 'none');
				}
		});
		//需求名称模糊匹配1.5延迟
		var demandNameTimer = null;
		$("#demandname").keyup(function(){
			clearTimeout(demandNameTimer);
			var jsonDate;
			var demandName = $("#demandname").val();
				jsonDate={demandName:demandName};
				if(demandName!="" && demandName.length>1){
					demandNameTimer = setTimeout(function(){
						$.ajax({
							url : "<%=path%>/channelManage/ajaxSelectDemandName",
							type : 'POST',
							async : true,
							dataType:'json',
							data:jsonDate,
							success : function(data) {
								$("#demand_name").html("");
								var str = "<ul style='width: 1000px; height: 200px;' id='demandLis'>";
								for (var i=0;i<data.length;i++){
									str+="<li class='demand'  onclick = 'indexChannelDemandVal(this)' style='background-color: white;text-align: left;cursor: pointer;'>"+data[i].demandName+"</li>"
								}
								str+="</ul>"
								$("#demand_name").append(str)
								$("#demand_name").css('display', 'block');
								//绑定鼠标移出移出效果
							    $(".demand").hover(function () {
							        $(this).css('background-color', '#1C86EE').css('color', 'white');
							    }, function () {
							        $(this).css('background-color', 'white').css('color', 'black');
							    });
							}
							
						});
					}, 1000);
				}else{
					$("#demand_name").css('display', 'none');
			  }
		});
		//需求编号模糊匹配1.5延迟
		var demandNumberTimer = null;
		$("#partnerNumber").keyup(function(){
			var jsonDate;
			var partnerNumber = $("#partnerNumber").val();
				jsonDate={partnerNumber:partnerNumber};
				clearTimeout(demandNumberTimer);
				if(partnerNumber!="" && partnerNumber.length>1){
					demandNumberTimer = setTimeout(function(){
						$.ajax({
							url : "<%=path%>/channelManage/ajaxSelectDemandNumber",
							type : 'POST',
							async : true,
							dataType:'json',
							data:jsonDate,
							success : function(data) {
								$("#demand_number").html("");
								var str = "<ul style='width: 130px; height: 200px;' id='numberLis'>"
								for (var i=0;i<data.length;i++){
									str+="<li class='number' onclick = 'indexDemandNumberVal(this)'  style='background-color: white;width: 100%;height: 20px;font-size: 13px;line-height: 20px;text-align: left;cursor: pointer;'>"+data[i].partnerNumber+"</li>"
								}
								str+="</ul>"
								$("#demand_number").append(str)
								$("#demand_number").css('display', 'block');
								//绑定鼠标移出移出效果
							    $(".number").hover(function () {
							        $(this).css('background-color', '#1C86EE').css('color', 'white');
							    }, function () {
							        $(this).css('background-color', 'white').css('color', 'black');
							    });
							}
							
						});
					}, 1000);
				}else{
					$("#demand_number").css('display', 'none');
				}
		});
	})
	function indexDemandNumberVal(data){
		$("#partnerNumber").val($(data).text())
	}
	function indexChannelCodeVal(data){
		$("#channelCode").val($(data).text())
	}
	function indexChannelVersionVal(data){
		$("#channelversion").val($(data).text())
	}
	function indexChannelDemandVal(data){
		$("#demandname").val($(data).text())
	}
	/* 获取条件查询 */
	function queryChannelInfo(displayPage){
		var channelCode= $("#channelCode").val();
		var channelSort= $("#channelSort").val();
		var channelVersion= $("#channelversion").val();
		var demandName= $("#demandname").val();
		var premiumBeginDate=$("#premiumBeginDate").val();
		var premiumEndDate=$("#premiumEndDate").val();
		var partnerNumber=$("#partnerNumber").val();
		loadQueryData({current:displayPage,size:10,channelCode: channelCode, channelSort: channelSort, channelVersion: channelVersion, demandName: demandName,premiumBeginDate:premiumBeginDate,premiumEndDate:premiumEndDate,partnerNumber:partnerNumber});
	}
	/*  加载页面    */
	function loadQueryData(param){
		var jsonDate;
		if(null != param && null != param.current){
			jsonDate =param;	
		}else{
			jsonDate={current:1,size:10};
		}
		$.openLoading();
		$.ajax({
			url : "<%=path%>/channelManage/queryDemandList",
			type : 'POST',
			async : true,
			dataType:'json',
			data:jsonDate,
			success : function(page) {
				$.closeLoading();
				var fieldNames = "Id@TDH,partnerNumber,channelVersion,channelCode,channelSort,demandName,partnerSystem,nlifeSystem,coreFive,coreSeven,ePolicySystem,cost@TDH";
				var lastButton = "<a href='javascript:void(0)' onClick='demandCost(this);return false'>成本</a>&nbsp;<a href='javascript:void(0)' onClick='demandEdit(this);return false'>编辑</a>&nbsp;<a href='javascript:void(0)' onClick='demandDelete(this);return false'>删除</a>";
				var tableContent = creatTable(fieldNames, page,lastButton);
				var tableObj = $("#channelDemandConfigTable");
				tableObj.find("tbody").remove();
				tableObj.append(tableContent);
				var strPage = creatChannelPage(page.current,6,page.maxPage,"1");
				var pageDIV = $("#channelDemandConfigPageDIV");
				pageDIV[0].innerHTML="";
				pageDIV.append(strPage);
				/* checkboxHighlight(); */
			}
		})
	}
	/* 选中高亮 */
/*     function checkboxHighlight(){
		$("input[name='checkbox']").click(function(){
			if($(this).is(':checked')){
				$(this).parent().parent().addClass("table_highlighter");
				var channelCode=$(this).parent().parent().children()[3].innerHTML;
				$(this).val(channelCode)
			}else{
				$(this).parent().parent().removeClass("table_highlighter");
			}
	   	});
    } */
	/*  需求删除   */
    function demandDelete(param) {
    	var id = $(param).parent().parent().children()[0].innerHTML;
    	var jsonDate={id:id};
    	$.openLoading();
		$.ajax({
			url : "<%=path%>/channelManage/demandDelete",
			type : 'POST',
			async : true,
			dataType:'json',
			data: jsonDate,
			success : function(data) {
				$.closeLoading();
    			if(data.data=="success"){
    				$.message("success", "删除成功")
    			}else{
    				$.message("error", "删除失败")
    			}
    			queryChannelInfo(1)
			}
		})
	}
	/* 需求编辑 */
	function demandEdit(param){
		var id = $(param).parent().parent().children()[0].innerHTML
		var jsonDate={id:id};
		$.openLoading();
		$.ajax({
			url : "<%=path%>/channelManage/queryDemandForUpdate",
			type : 'POST',
			async : true,
			dataType:'json',
			data:jsonDate,
			success : function(data) {
				$.closeLoading();
				$("#editId").val(data.id)
				$("#editVersionNo").val(data.channelVersion)
				$("#editChannelCode").val(data.channelCode)
				$("#editChannelSort").val(data.channelSort)
				$("#editDemandName").val(data.demandName)
				$("#editPartnerSystem").val(data.partnerSystem)
				$("#editNlifeSystem").val(data.nlifeSystem)
				$("#editCoreVF").val(data.coreFive)
				$("#editCoreVS").val(data.coreSeven)
				$("#editEpolicySystem").val(data.ePolicySystem)
				$("#editPartnerNumber").val(data.partnerNumber)
				$("#editDemandDiv").OpenDiv()
			}
		})
		
	}
	/* 需求编辑保存 */
	function demandEditSave(){
		var Id = $("#editId").val()
		var channelVersion = $("#editVersionNo").val();
		var partnerNumber = $("#editPartnerNumber").val();
		var	channelCode	= $("#editChannelCode").val();
		var	channelSort	= $("#editChannelSort").val();
		var	demandName	= $("#editDemandName").val();
		var	partnerSystem	= $("#editPartnerSystem").val();
		var	nlifeSystem	= $("#editNlifeSystem").val();
		var	coreFive = $("#editCoreVF").val();
		var	coreSeven = $("#editCoreVS").val();
		var	ePolicySystem = $("#editEpolicySystem").val();
		var jsonDate={id:Id,channelVersion:channelVersion,channelCode:channelCode,channelSort:channelSort,demandName:demandName,partnerSystem:partnerSystem,nlifeSystem:nlifeSystem,coreFive:coreFive,coreSeven:coreSeven,ePolicySystem:ePolicySystem,partnerNumber:partnerNumber};
		$.openLoading();
		$.ajax({
			url : "<%=path%>/channelManage/updateChannelDemand",
			type : 'POST',
			async : true,
			dataType:'json',
			data:jsonDate,
			success : function(data) {
				$.closeLoading();
    			if(data.data=="success"){
    				$.message("success", "修改成功")
    				$("#editDemandDiv").CloseDiv()
    				queryChannelInfo(1)
    			}
    			if(data.data=="error"){
    				$.message("error", "修改失败")
    			}
    			if(data.data=="exit"){
    				$.message("error", "版本号不存在")
    			}
			}
		})
		
	}
	//成本
	function demandCost(param){
		var id = $(param).parent().parent().children()[0].innerHTML
		$("#idHidden").val(id)
		loadDemandCostList(id)
		$("#addOrUpdateDiv").OpenDiv();
		
	}
	//加载成本列表
	function loadDemandCostList(param){
		var jsondata={id:param};
		$.ajax({
			url : "<%=path%>/channelManage/queryDemandCostList",
			type : 'POST',
			async : true,
			data:jsondata,
			dataType:'json',
			success : function(data) {
				if($.validate(data))  return;
				if(null != data){
					 var buttonStr = "<a href='' onClick='delDemandCost(this);return false'>删除</a>";
					var fieldNames = "id@TDH,systemCode@TDH,systemName,channelCost";
					var tableContent = creatTable(fieldNames,data,buttonStr);
					var tableObj = $("#costTable");
					tableObj.find("tbody").remove();
					tableObj.append(tableContent); 
				}
			
				 loadSystemSelect(jsondata);
			}
		});
	}
	function loadSystemSelect(param){
		$.ajax({
			url : "<%=path%>/channelManage/querySystemName",
			type : 'POST',
			async : false,
			data:param,
			dataType:'json',
			success : function(data) {
				if($.validate(data))  return;
				var systemSelect = document.getElementById("systemSelect");
				systemSelect.options.length = 0;
				if (data===null){
					var option = new Option();
					option.text = "无可选系统！";
					option.value = "";
					systemSelect.add(option);
					disabledBtn("systemTypeBtn");//禁用按钮
				}else if(data.length > 0){
					for (var i = 0; i < data.length; i++) {
						var option = new Option();
						option.text = data[i].codeName;
						option.value = data[i].code;
						systemSelect.add(option);
					}
					
					enabledBtn("systemTypeBtn");//启用按钮
				}
			}
		});
	}
	//新增成本
	function saveChannelTranstype(){
		var channelCost = $("#demandCosts").val();
		if(channelCost.replace(/[^\d.]/g, "")==""){
			$.message("error", "请填写成本")
			return;
		}
		var systemName = $("#systemSelect").find("option:selected").text(); 
		var systemCode = $("#systemSelect").find("option:selected").val(); 
		var id = $("#idHidden").val();
		$.openLoading();
		$.ajax({
			url : "<%=path%>/channelManage/saveDemandCost",
			type : 'POST',
			async : true,
			data:{
				id:id,
				systemCode:systemCode,
				systemName:systemName,
				channelCost:channelCost
			},
			dataType:'json',
			success : function(data) {
				$.closeLoading();
				$("#demandCosts").val("")
				if($.validate(data))  return;
				$.message("success", "添加成功")
				loadDemandCostList(id);
			}
		});
	}
	//启用
	function enabledBtn(btnId){
		var enabledBtn = $("#"+btnId+"");
		enabledBtn.removeAttr("disabled");
		enabledBtn.css("backgroundImage","url('./images/button_1.png')");
	}
	//禁用
	function disabledBtn(btnId){
		var disabledBtn = $("#"+btnId+"");
		disabledBtn.attr("disabled","disabled");
		disabledBtn.css("background","gray");
	}

    //统一 关闭  窗口
	function closeCurrentDIV(obj){
		$("#"+obj).CloseDiv();
	}
    
	function delDemandCost(param){
		var id =  $(param).parent().parent().children()[0].innerHTML
		var systemCode = $(param).parent().parent().children()[0].innerHTML		
		$.openLoading();
		$.ajax({
			url : "<%=path%>/channelManage/delDemandCost",
			type : 'POST',
			async : true,
			dataType:'json',
			data: {id:id,systemCode:systemCode},
			success : function(data) {
				$.closeLoading();
    			if(data.data=="success"){
    				$.message("success", "删除成功")
    			}else{
    				$.message("error", "删除失败")
    			}
    			loadDemandCostList(id);
			}
		})
		
	}
    
    
    // 重置查询条件
	function resetSearch() {
		$('#channelCode').val('')
		$('#channelSort').val('')
		$('#channelversion').val('')
		$('#demandname').val('')
		$('#premiumBeginDate').val('')
		$('#premiumEndDate').val('')
		$('#partnerNumber').val('')
	}
    
    function add(){
    	var strs="";
    	var strStyle="style='width:90px;'";
    	var strStyle2="style='width:200px;'";
    	var strStyle3="style='width:80px;'";
    	var strStyle4="style='width:70px;'";
    	var strStyle5="style='width:76px;'";
     	for(var i=1;i<=5;i++){
    		var str="";
  			for(var j=0;j<=10;j++){
  				if(j==0){
  					str+="<tr><td><span>"+i+"</span></td>"
  				}else if(j==1){
  					str+="<td style='position:relative;'><input id='partnerNumber"+i+"' type='text' class='input_text'  value=''"+strStyle+"/></td>"
  				}else if(j==2){
  					str+="<td style='position:relative;'><input id='version"+i+"' type='text' class='input_text' onkeyup='versionKeyup(this)' value=''"+strStyle+"/>"+"<div style='z-index: 14;  position: absolute;width: 90%;height: 110px;border: 2px solid #66afe9;border-top: 0px;overflow-x:hidden;overflow-y:auto;display: none;margin-left: 1px' id='addPageChannelVersionDiv"+i+"'></div></td>"
  				}else if(j==3){
					str+="<td style='position:relative;'><input id='channelCodes"+i+"' type='text'  onkeyup='keyup(this)' class='input_text' value=''"+strStyle+"/>"+"<div style='z-index: 14;  position: absolute;width: 90%;height: 110px;border: 2px solid #66afe9;border-top: 0px;overflow-x:hidden;overflow-y:auto;display: none;margin-left: 1px' id='addPageChannelCodeDiv"+i+"'></div></td>"

  				}else if(j==4){
					str+="<td style='position:relative;'><input id='channelSort"+i+"' type='text' class='input_text' value='' style='background-color: rgb(204, 204, 204);width:80px;' readonly='readonly'/></td>"
  				}else if(j==5){
  					str+="<td style='position:relative;'><input id='demandName"+i+"' type='text'   onkeyup='demandNameKeyup(this)'class='input_text' value=''"+strStyle2+"/>"+"<div style='z-index: 14;position: absolute;height: 110px;border: 2px solid #66afe9;border-top: 0px;overflow-x:hidden;overflow-y:auto;display: none;margin-left: -1px;width: 198px;' id='addDemandSerachDiv"+i+"'></div></td>"
  				}else if(j==6){
					str+="<td style='position:relative;'><input id='prrtnerSystem"+i+"' type='text' class='input_text' onkeyup='clearNoNumber(this)'  value=''"+strStyle+"/></td>"
  				}else if(j==7){
					str+="<td style='position:relative;'><input id='nlifeSystem"+i+"' type='text' class='input_text'  onkeyup='clearNoNumber(this)' value=''"+strStyle+"/></td>"
  				}else if(j==8){
					str+="<td style='position:relative;'><input id='corevFive"+i+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value=''"+strStyle5+"/></td>"
  				}else if(j==9){
					str+="<td style='position:relative;'><input id='corevSeven"+i+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value=''"+strStyle4+"/></td>"
  				}else if (j==10){
					str+="<td style='position:relative;'><input id='epolicySystem"+i+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value=''"+strStyle3+"/></td>"
  				}
  			}
    		str+="";
    		strs+=str;
    	}
    	
    	var tableObj = $("#demandTable");
		tableObj.find("tbody").remove();
		tableObj.append(strs); 
    	$("#addChannelDemandsDiv").OpenDiv();
    }
    //新增一行
    function addLine(){
    	var numberLine =parseInt($("#demandTable tr:last").find('td').children()[0].innerHTML)+1;
    	var str="<tr><td style='position:relative;'><span>"+numberLine+"</span></td>"
    	+"<td style='position:relative;'><input id='partnerNumber"+numberLine+"' type='text' class='input_text'  value='' style='width:90px;'/></td>"	
    	+"<td style='position:relative;'><input id='version"+numberLine+"' type='text' class='input_text'  onkeyup='versionKeyup(this)' value='' style='width:90px;'/>"+"<div style='z-index: 14;  position: absolute;width: 90%;height: 110px;border: 2px solid #66afe9;border-top: 0px;overflow-x:hidden;overflow-y:auto;display: none;margin-left: 1px' id='addPageChannelVersionDiv"+numberLine+"'></div></td>"
    	+"<td style='position:relative;'><input id='channelCodes"+numberLine+"' type='text' class='input_text' value='' onkeyup='keyup(this)' style='width:90px'/>"+"<div style='z-index: 14;  position: absolute;width: 90%;height: 110px;border: 2px solid #66afe9;border-top: 0px;overflow-x:hidden;overflow-y:auto;display: none;margin-left: 1px' id='addPageChannelCodeDiv"+numberLine+"'></div></td>"
    	+"<td style='position:relative;'><input id='channelSort"+numberLine+"' type='text' class='input_text' value='' style='width:80px;background-color: rgb(204, 204, 204);' readonly='readonly'/></td>"
    	+"<td style='position:relative;'><input id='demandName"+numberLine+"' type='text' class='input_text' value='' style='width:200px'   onkeyup='demandNameKeyup(this)'/>"+"<div style='z-index: 14;position: absolute;height: 110px;border: 2px solid #66afe9;border-top: 0px;overflow-x:hidden;overflow-y:auto;display: none;margin-left: -1px;width: 198px;' id='addDemandSerachDiv"+numberLine+"'></div></td>"
    	+"<td style='position:relative;'><input id='prrtnerSystem"+numberLine+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value='' style='width:90px'/></td>"
    	+"<td style='position:relative;'><input id='nlifeSystem"+numberLine+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value='' style='width:90px'/></td>"
    	+"<td style='position:relative;'><input id='corevFive"+numberLine+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value='' style='width:76px'/></td>"
    	+"<td style='position:relative;'><input id='corevSeven"+numberLine+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value='' style='width:70px'/></td>"
    	+"<td style='position:relative;'><input id='epolicySystem"+numberLine+"' type='text' class='input_text' onkeyup='clearNoNumber(this)' value='' style='width:80px'/></td>"
    	$("#demandTable").find("tbody").append(str)
    }
    //统一 关闭  窗口
	function closeCurrentDIV(obj){
		$("#"+obj).CloseDiv();
		$("#premiumBeginDate").val("");
		$("#premiumEndDate").val("");
		$("#costBeginDate").val("");
		$("#costEndDate").val("");
	}
    //需求保存
    function saveDemand(){
    	var demands = new Array();
    	var jsonData = "";
    	var errorMessage="";
    	var lastLine =parseInt($("#demandTable tr:last").find('td').children()[0].innerHTML);
    	for(var i=1;i<=lastLine;i++){
    		jsonData="";
    		var channelVersion=$("#version"+i).val();
    		var channelCode=$("#channelCodes"+i).val();
    		var demandName=$("#demandName"+i).val();
    		if(channelCode!=""||demandName!=""){
    			if(channelVersion==""){
    	  			errorMessage+="第"+i+"行版本日期不能为空"+"<br>"
        			continue;
    			}
    		}
    		if(channelVersion!=""||demandName!=""){
    			if(channelCode==""){
    	   			errorMessage+="第"+i+"行合作伙伴代码不能为空"+"<br>"
        			continue;
    			}
    		}
    		
    		var channelSort=$("#channelSort"+i).val();
    		if(channelVersion!=""||channelCode!=""){
    			if(demandName==""){
        			errorMessage+="第"+i+"行需求名称不能为空"+"<br>"
        			continue;
    			}
    		}
    		if(list.indexOf(parseInt(channelVersion))==-1 &&channelCode!=""&&demandName!=""){
    			errorMessage+="第"+i+"行版本日期不存在"+"<br>"
    			continue;
    		}
    		var partnerSystem=$("#prrtnerSystem"+i).val();
    		var nlifeSystem=$("#nlifeSystem"+i).val();
    		var coreFive=$("#corevFive"+i).val();
    		var coreSeven=$("#corevSeven"+i).val();
    		var ePolicySystem=$("#epolicySystem"+i).val();
    		var creditSystem=$("#creditSystem"+i).val();
    		var partnerNumber=$("#partnerNumber"+i).val();
    		if(channelVersion!=""&&channelCode!=""&&demandName!=""){
        		jsonData={channelVersion:channelVersion,channelCode:channelCode,channelSort:channelSort,demandName:demandName,partnerSystem:partnerSystem,nlifeSystem:nlifeSystem,coreFive:coreFive,coreSeven:coreSeven,ePolicySystem:ePolicySystem,creditSystem:creditSystem,partnerNumber:partnerNumber}
        		demands.push(jsonData);	
    		}
    	}
    	if(errorMessage!=""){
    		$.dialog({
    			width: 358,
    			top:50,
    			modal:true,
    			Close:true,
    			cancel:null,
    			content: errorMessage
    		});
    		return;
    	}
    	if(demands.length==0){
    		$.message("error", "请填写至少一行数据")
    		return;
    	}
    	$.openLoading();
     	 $.ajax({
    		url : "<%=path%>/channelManage/addDemands",
    		type : "POST",
    		data :  JSON.stringify(demands),
    		dataType : 'json',
    		async : true,
    		contentType  :  'application/json;charset=utf-8',
    		success : function(data){
    			$.closeLoading();
    			if(data.data=="success"){
    				$.message("success", "插入成功")
    				queryChannelInfo(1)
    				$("#addChannelDemandsDiv").CloseDiv();
    			}else{
    				$.message("error", "插入失败")
    			}
    		}
    		
    	});
    }
    //合作伙伴
    var addPagePartnerCodeTimer = null;
    function keyup(parameter){
    	var id= parameter.id;
    	var channelCode = $("#"+id).val();
    	clearTimeout(addPagePartnerCodeTimer);
    	var jsonDate;
    	var channelSortInputId = "channelSort"+id.substring(12)
 		if(channelCode==""){
 			$("#"+channelSortInputId).val("")
 		}
    	jsonDate={channelCode:channelCode};
    	var linNumber = $(parameter).parent().parent().find('td').children()[0].innerHTML
    	if(channelCode!="" && channelCode.length>1){
    		addPagePartnerCodeTimer = setTimeout(function(){
				$.ajax({
					url : "<%=path%>/channelManage/ajaxSelectChannelCode",
					type : 'POST',
					async : true,
					dataType:'json',
					data:jsonDate,
					success : function(data) {
						$("#addPageChannelCodeDiv"+linNumber).html("");
						var str = "<ul style='width: 88px; height: 110px;'>";
						for (var i=0;i<data.length;i++){
							str += "<li class='channelCodeClass' style='background-color: white;text-align:left;font-size: 12px;line-height: 20px;'onclick='addDemandPageLi(this)' value2='"+data[i].channelSort+"'>"+ data[i].channelCode +"</li>"
						}
						str+="</ul>"
						$("#addPageChannelCodeDiv"+linNumber).append(str)
						$("#addPageChannelCodeDiv"+linNumber).css('display', 'block');
						   $("#addChannelDemandsDiv").click(function () {
						    	$("[id^='addPageChannelCodeDiv']").hide();
						    });
						//绑定鼠标移出移出效果
					    $(".channelCodeClass").hover(function () {
					        $(this).css('background-color', '#1C86EE').css('color', 'white');
					    }, function () {
					        $(this).css('background-color', 'white').css('color', 'black');
					    });
					}
					
				});
			}, 1000);		
    	}
    }
    //需求名称
    var addPageDemandNameTimer=null;
   function demandNameKeyup(parameter){
   	clearTimeout(addPageDemandNameTimer);
	var jsonDate;
	var id= parameter.id;
	var demandName = $("#"+id).val();
	jsonDate={demandName:demandName};
	var linNumber = $(parameter).parent().parent().find('td').children()[0].innerHTML
	if(demandName!="" && demandName.length>1){
		addPageDemandNameTimer = setTimeout(function(){
			$.ajax({
				url : "<%=path%>/channelManage/ajaxSelectDemandName",
				type : 'POST',
				async : true,
				dataType:'json',
				data:jsonDate,
				success : function(data) {
					$("#addDemandSerachDiv"+linNumber).html("");
					var str = "<ul style='width: 298px; height: 110px;'>";
					for (var i=0;i<data.length;i++){
						str += "<li class='demandNameClass' style='background-color: white;text-align:left;font-size: 13px;line-height: 20px;'onclick='addDemandPageLi(this)'>"+data[i].demandName+"</li>"
					}
					str+="</ul>"
					$("#addDemandSerachDiv"+linNumber).append(str)
					$("#addDemandSerachDiv"+linNumber).css('display', 'block');
					   $("#addChannelDemandsDiv").click(function () {
					    	$("[id^='addDemandSerachDiv']").hide();
					    });
					//绑定鼠标移出移出效果
				    $(".demandNameClass").hover(function () {
				        $(this).css('background-color', '#1C86EE').css('color', 'white');
				    }, function () {
				        $(this).css('background-color', 'white').css('color', 'black');
				    });
				}
				
			});
		}, 1000);		
	}
   }
   //版本号
   var addPageVersionTimer=null;
  function versionKeyup(parameter){
  	clearTimeout(addPageDemandNameTimer);
	var jsonDate;
	var id= parameter.id;
	var versionNo = $("#"+id).val();
	jsonDate={versionNo:versionNo};
	var linNumber = $(parameter).parent().parent().find('td').children()[0].innerHTML
	if(versionNo!="" && versionNo.length>1){
		addPageVersionTimer = setTimeout(function(){
			$.ajax({
				url : "<%=path%>/channelManage/ajaxSelectChannelVersion",
				type : 'POST',
				async : true,
				dataType:'json',
				data:jsonDate,
				success : function(data) {
					$("#addPageChannelVersionDiv"+linNumber).html("");
					var str = "<ul style='width: 88px; height: 110px;'>";
					for (var i=0;i<data.length;i++){
						str += "<li class='versionDateClass' style='background-color: white;text-align:left'onclick='addDemandPageLi(this)'>"+data[i].channelVersion+"</li>"
					}
					str+="</ul>"
					$("#addPageChannelVersionDiv"+linNumber).append(str)
					$("#addPageChannelVersionDiv"+linNumber).css('display', 'block');
					   $("#addChannelDemandsDiv").click(function () {
					    	$("[id^='addPageChannelVersionDiv']").hide();
					    });
					//绑定鼠标移出移出效果
				    $(".versionDateClass").hover(function () {
				        $(this).css('background-color', '#1C86EE').css('color', 'white');
				    }, function () {
				        $(this).css('background-color', 'white').css('color', 'black');
				    });
				}
				
			});
		}, 1000);		
	}
  }
   
    //li标签点击事件
	function addDemandPageLi (data){
	 	var inputValue = $(data).parent().parent().parent().children("input:eq(0)")
		var InputId=inputValue.attr('id');
		var reg = RegExp(/channelCodes/);
		var value = $(data).attr("value2");
		if(InputId.match(reg)){
			var versionInputId = "channelSort"+InputId.substring(12)
			if("null"==value){
				value=""
			}
			$("#"+versionInputId).val(value);
		}
		$(inputValue).val($(data).text())
	}

	function addversion (){
		$("#addVersionDiv").OpenDiv();
	}
	function returnVersionNumber(){
		var temp = $("#versionDate").val();
		var splitArr=temp.split("-")
		$("#versionNumber").val(splitArr[0]+splitArr[1]+splitArr[2])
	}
	function addVersionsForDemand(){
		var channelVersion = $("#versionNumber").val();
		if(channelVersion==""){
			$.message("error", "请选择版本日期")
			return;
		}
		jsonData={channelVersion:channelVersion}
    	$.openLoading();
		$.ajax({
			url : "channelManage/addVersions",
			type : 'POST',
			async : true,
			dataType:'json',
			data: jsonData,
			success : function(data) {
				$.closeLoading();
				if(data.data=="success"){
    				$.message("success", "添加成功")
    				$("#addVersionDiv").CloseDiv();
    				window.location.href='<%=basePath%>'+"channelManage/demandConfigPage"
    			}else{
    				$.message("error", "版本已存在")
    			}
			}
		})
	}
	//导入
	function upLoadExcelForDemand(param){
		var reg = RegExp(/.xls/);
 		if(param.match(reg)){ 
	    	$.openLoading();
			$.ajaxFileUpload({
				url : "<%=path%>/channelManage/demandExcelImport",
				fileElementId :'excelFile',//file控件id
				dataType:'json',
				success : function(data) {
					$("#excelFile").val("")
					$.closeLoading();
		        	if(data.result=="error"||data.result=="fail"){
		        		$.dialog({
			    			width: 358,
			    			top:40,
			    			modal:true,
			    			Close:true,
			    			cancel:null,
			    			content: data.message
			    		});
			        	return;
		        	}
		        	if($.validate(data)) return;
		        	queryChannelInfo(1)
				}
			})
			
 		}else{
			$.message("error", "暂不支持此文件类型")
		} 
	}
	function demandExport(){
		var channelCode= $("#channelCode").val();
		var channelSort= $("#channelSort").val();
		var channelVersion= $("#channelversion").val();
		var demandName= $("#demandname").val();
		var premiumBeginDate=$("#premiumBeginDate").val();
		var premiumEndDate=$("#premiumEndDate").val();
		 window.open("<%=basePath%>"+"channelManage/demandExportExcel?channelCode="+channelCode+"&channelSort="+channelSort+"&channelVersion="+channelVersion+"&demandName="+encodeURI(encodeURI(demandName))+"&premiumBeginDate="+premiumBeginDate+"&premiumEndDate="+premiumEndDate);
		
	}
	//字符限制
	function clearNoNumber(obj){
		obj.value = obj.value.replace(/[^\d.]/g, "");
	}
	//模板下载
	function demandExcelDownload(){
		window.location.href='<%=basePath%>'+"channelManage/demandExcelDownload"
	}
	

	</script>
</head>
<body >
	<div class="current">
		<table class="current_table_1">
			<tbody>
				<tr class="f2">
		            <td>
		              <img src="./images/current_1.jpg">
		            </td>
		            <td class="current_table_1_td">
		              <img src="images/current_1.png">&nbsp;您现在的位置：&nbsp;
		                <span style=" color:#136bab; ">合作伙伴管理
		                	<span style="padding:0 5px; font-weight:bold; line-height:28px;">&gt;</span>
		                	合作伙伴需求配置
		            	</span>
		            </td>
		            <td><img src="./images/current_3.jpg"></td>
	        	</tr>
			</tbody>
		</table>
	</div>			
		
	<table class="table_02" id="table">
		<tr>
			<td>
				<table class="search_table">
					<tr  class="h_30">
						<td style="border: 0;text-align: right;width: 110px;position:relative;" nowrap="nowrap" class="h_30">合作伙伴分类：</td>
						<td style="position:relative;width: 125px;">
							<select class="search_select_1" id="channelSort">
								<option value="">--请选择--</option>
								<c:forEach items="${channelSortList}" var="info">
								<option value="${info.code}">${info.codeName}</option>
								</c:forEach>
							</select>
						</td>
						<td style="border: 0;text-align: right;width:110px;position:relative;" nowrap="nowrap" class="h_30">合作伙伴代码：</td>
						<td style="position:relative;width: 125px;">
							<input name="channelCode" id="channelCode" type="text" class="input_text" maxlength="30" value=""> 
							<div style="position: absolute;" id="channel_code">
							</div>
						</td>
						<td style="border: 0;text-align: right;width: 80px;position:relative;" nowrap="nowrap" class="h_30">版本号：</td>
						<td style="position:relative;width: 125px;">
							<input name="version" id="channelversion" type="text" class="input_text" maxlength="30" value="">
							<!--模糊匹配窗口-->
							<div style="position: absolute;" id="channel_version">
							</div>
						</td>
						<td style="border: 0;text-align: right;width:90px;position:relative;" nowrap="nowrap" class="h_30">需求名称：</td>
						<td style="position:relative;width: 281px">
							<input name="demandName" id="demandname" type="text" class="input_text" maxlength="300" style="width: 282px;" value="">
							<!--模糊匹配窗口-->
							<div style="position: absolute;" id="demand_name">
							</div>
						</td>
					</tr>
 					<tr>
 						<td style="border: 0;text-align: right;width:110px;position:relative" nowrap="nowrap" class="h_30">需求编号：</td>
						<td style="position:relative;width: 125px;">
							<input name="partnerNumber" id="partnerNumber" type="text" class="input_text" maxlength="30" value="">
							<div style="position: absolute;"  id="demand_number">
							</div>
						</td>
						<td style="border: 0;text-align: right;" nowrap="nowrap" class="h_30">开始日期：</td>
						<td><input id="premiumBeginDate" onkeydown="false" onclick="showCalendar('premiumBeginDate','y-mm-dd');" readonly="readonly" class="input_time" type="text" /></td>
						<td style="border: 0;text-align: right;" nowrap="nowrap" class="h_30">结束日期：</td>
						<td><input id="premiumEndDate" onkeydown="false" onclick="showCalendar('premiumEndDate','y-mm-dd');" readonly="readonly" class="input_time" type="text" /></td>
					</tr>
					<tr height="30px">
						<td height="30px"  colspan="8" style="text-align: center;">
							<input type="button" class="input_button_1" id="searchBtn" style="cursor: pointer;" value="查询" onClick="queryChannelInfo(1)"/>
						    <input type="button" class="input_button_1" id="resetBtn" style="cursor: pointer;" value="重置" onClick="resetSearch()" />
						    <input type="button" class="input_button_1" id="resetBtn" style="cursor: pointer;" value="导出" onClick="demandExport()"/>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<table class="search_table">
					<tr class="h_30">
						<td class="h_30">
						    <input type="button" class="input_button_1" style="cursor: pointer;" id="" value="新增" onclick="add()" />
							<input type="button" class="input_button_2" style="cursor: pointer;" id="" value="新增版本号" onclick="addversion()" />
							<!-- <input type="button" class="input_button_1" id="" value="导出" onclick="exports()" /> -->
							<input type="file" name="excelFile" id="excelFile"style="display: none;" onchange="upLoadExcelForDemand(this.value)" multiple="multiple" accept="xlsx/*" />
							<input type="button" class="input_button_1" id="" style="cursor: pointer;" value="导入" onclick="$('#excelFile').click()" />
							<input type="button" class="input_button_2" id="" style="cursor: pointer;" value="模板下载" onclick="demandExcelDownload()" />
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td>
				<div>
					<table id="channelDemandConfigTable" class="content_table_1">
						<thead>
							<tr class="f1">
								<th style="width:5.5%;">需求编号</th>
								<th style="width:4.3%;">版本号</th>
								<th style="width:7%;">合作伙伴代码</th>
								<th style="width:8%;">合作伙伴分类</th>
								<th style="width:20%;">需求名称</th>
								<th style="width:7%;">合作伙伴系统</th>
								<th style="width:7%;">新意健险系统</th>
								<th style="width:4%;">核心V5</th>
								<th style="width:4%;">核心V7</th>
								<th style="width:7%;">电子保单系统</th>
								<th style="width:9%;">操作</th>
							</tr>
						</thead>
						<tbody>
						</tbody>
					</table>
				</div>
				<div id="channelDemandConfigPageDIV" class="page"></div>
			</td>
		</tr>
	</table>

	<div id="addChannelDemandsDiv" style="display: none; width: 95%;">
		<input type="hidden" id="row_num" name="row_num" value="0" />

		<div style='width: 100%; line-heighe: 20px; background-color: #A4BDE3'>
			<table class="table_title">
				<tr>
					<td width="70px"></td>
					<td width="100%" id="interfaceName"></td>
					<td width="40px" align="right"><img src="<%=path%>/images/closedown.gif" alt="关闭"
						onclick="closeCurrentDIV('addChannelDemandsDiv')" /></td>
				</tr>
			</table>
		</div>
		<div style="width: 100%; height: 250px; overflow: scroll;" id="addDiv">
			
				<table class="table_02" id="addDemandTable" align="center">
					<tbody>
						<tr>
							<td>
								<table id="demandTable" class="content_table_1">
									<thead>
										<tr class="f1">
											<th>序号</th>
											<th>需求编号</th>
											<th>版本号</th>
											<th>合作伙伴代码</th>
											<th>合作伙伴分类</th>
											<th>需求名称</th>
											<th>合作伙伴系统</th>
											<th>新意健险系统</th>
											<th>核心V5</th>
											<th>核心V7</th>
											<th>电子保单系统</th>
										</tr>
									</thead>
									<tbody>
									</tbody>
								</table>
							</td>
						</tr>
					</tbody>
				</table>
				<div align="center" style="position: relative; z-index:2;left: auto; right: auto;   ">
					<input class="input_button_3" name="" type="button" onclick="saveDemand()" value="保存">&nbsp;&nbsp; 
					<input class="input_button_3" name="" type="button" onclick="closeCurrentDIV('addChannelDemandsDiv')" value="取消">&nbsp;&nbsp;
					<input class="input_button_3" name="" type="button" onclick="addLine()" value="新增">
					<input type="hidden" id="hiddenButton" value="">
				</div>
		</div>
		<div style="z-index: 14; left:52px; position: absolute;display: none" id="addPageChannelCode">
								<ul style="width: 78px; height: 110px;">
<%-- 									<c:forEach items ="${partnerInfo}" var = "infos">
									<li class="channelCodeClass" style="background-color: white;width: 100%;font-size: 12px;line-height: 20px;"onclick="addDemandPageLi(this)" value2="${infos.channelSort}">${infos.channelCode}</li>
								</c:forEach> --%>
								</ul>
						</div>
						<div style="z-index: 14; left:52px; position: absolute; display:none;" id="addPageDemandName">
								<ul style="width: 298px; height: 110px;">
<%-- 								<c:forEach items ="${demandInfo}" var = "infos">
								<li class="demandNameClass" style="background-color: white;width: 100%;font-size: 13px;line-height: 20px;"onclick="addDemandPageLi(this)">${infos.demandName}</li>
								</c:forEach> --%>
								</ul>
						</div>	
	</div>
<!-- 版本号添加DIV -->
	<div id="addVersionDiv"  style="display:none; width:40%;">
		<div class="table_title_div">
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="/manager/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('addVersionDiv')"/></td>
					</tr>
				</table>
		</div>
		<table id="addtempletTable" style="align:center;margin: 10px auto;border:0">
			<tbody>
				<tr>
					<td>
						<table id="coverageTable"  class="content_table_1" border="0" align="center">	
							<tbody>
								<tr style="text-align:center">
				                  <td width="40%" style="text-align:right;border-right:0px;">版本日期：&nbsp;</td>
				                  <td width="60%" style="text-align:left"><input id="versionDate" class="input_text" type="date"  onchange="returnVersionNumber()" value=""/></td>
				                </tr>
				                <tr style="text-align:center">  
				                  <td width="40%" style="text-align:right;border-right:0px;">版本号：&nbsp;</td>
				                  <td width="60%" style="text-align:left"><input id="versionNumber" readonly="readonly" name="versionNumber"  class="input_text" value="" ></td>
				                </tr>
							</tbody>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
		<div align="center">
		   <input class="input_button_3" name="" type="button" onclick="addVersionsForDemand()" value="确定">&nbsp;&nbsp;
           <input class="input_button_3" name="" type="button" onclick="closeCurrentDIV('addVersionDiv')" value="取消">
		</div>
	</div>
	
	
	<!-- 版本号添加DIV -->
	<div id="addVersionDiv"  style="display:none; width:40%;">
		<div class="table_title_div">
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
					<td width="10%"></td>
					<td width="80%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="/manager/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('addVersionDiv')"/></td>
					</tr>
				</table>
		</div>
		<table id="addtempletTable" style="align:center;margin: 10px auto;border:0">
			<tbody>
				<tr>
					<td>
						<table id="coverageTable"  class="content_table_1" border="0" align="center">	
							<tbody>
								<tr style="text-align:center">
				                  <td width="40%" style="text-align:right;border-right:0px;">版本日期：&nbsp;</td>
				                  <td width="60%" style="text-align:left"><input id="versionDate" class="input_text" type="date"  onchange="returnVersionNumber()" value=""/></td>
				                </tr>
				                <tr style="text-align:center">  
				                  <td width="40%" style="text-align:right;border-right:0px;">版本号：&nbsp;</td>
				                  <td width="60%" style="text-align:left"><input id="versionNumber" readonly="readonly" name="versionNumber"  class="input_text" value="" ></td>
				                </tr>
							</tbody>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
		<div align="center">
		   <input class="input_button_3" name="" type="button" onclick="addVersionsForDemand()" value="确定">&nbsp;&nbsp;
           <input class="input_button_3" name="" type="button" onclick="closeCurrentDIV('addVersionDiv')" value="取消">
		</div>
	</div>
	
	
<!-- 	
	<div id="statisticalInterval"  style="display:none; width:60%;">
		<div class="table_title_div">
				<table class="table_title" style='width:100%;height: 20px;'>
					<tr>
					<td width="10%"></td>
					<td width="70%" id="interfaceName"></td>
					<td width="10%" align="right"><img src="/manager/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('statisticalInterval')"/></td>
					</tr>
				</table>
		</div>
		<table id="statisticalIntervalTable" style="align:center;margin: 10px auto;border:0">
			<tbody>
				<tr>
					<td>
						<table id="statisticalIntervalTable1"  class="content_table_2" border="0" align="center">	
							<tbody>
								<tr style="text-align:center">
				                  <td width="35%" style="text-align:right;border-right:0px;">保费统计起始日期：&nbsp;</td>
				                  <td style="text-align:left;width: 2020px"><input id="premiumBeginDate" class="input_text" type="date"  value=""/>&nbsp;至&nbsp;<input id="premiumEndDate" class="input_text" type="date"  value=""/></td>
				                </tr>
				                <tr style="text-align:center">  
				                  <td width="35%" style="text-align:right;border-right:0px;">成本统计起始日期：&nbsp;</td>
				                  <td style="text-align:left;width: 2020px"><input id="costBeginDate" class="input_text" type="date" value=""/>&nbsp;至&nbsp;<input id="costEndDate" class="input_text" type="date" value=""/></td>
				                </tr>
							</tbody>
						</table>
					</td>
				</tr>
			</tbody>
		</table>
		<div align="center">
		   <input class="input_button_3" name="" type="button" onclick="demandExport()" value="确定">&nbsp;&nbsp;
           <input class="input_button_3" name="" type="button" onclick="closeCurrentDIV('statisticalInterval')" value="取消">
		</div>
	</div> -->

	<!-- 编辑 -->
 		<div id="editDemandDiv" style="display:none;width:600px;height:340px;">
		<input type="hidden" id="row_num" name="row_num" value="0"/>
			<div class="table_title_div">
					<table class="table_title" style='width:100%;height: 20px;'>
						<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('editDemandDiv')"/></td>
						</tr>
					</table>
			</div>
		<table class="table_02" id="saveAppTable" style="height:68%;width: 95%" align="center" >
 			 <tr>
				<td style="text-align:right;border-right:0px;" width="40%">需求编号：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editPartnerNumber" class="input_text"></td>
			</tr>
 			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">版本号：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editVersionNo" class="input_text"> <input type="hidden" id="editId" value=""></td>
			</tr>
			 <tr>
				<td style="text-align:right;border-right:0px;" width="40%">合作伙伴代码：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editChannelCode" class="input_text"></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">合作伙伴分类：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editChannelSort" class="input_text" readonly="readonly" style="background-color: rgb(204, 204, 204);"></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">需求名称：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editDemandName" class="input_text"></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">合作伙伴系统：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editPartnerSystem" class="input_text" onkeyup='clearNoNumber(this)' value=""></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">新意健险系统：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editNlifeSystem" class="input_text" onkeyup='clearNoNumber(this)' value=""></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">核心V5：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editCoreVF" class="input_text" onkeyup='clearNoNumber(this)' value=""></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">核心V7：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editCoreVS" class="input_text" onkeyup='clearNoNumber(this)' value=""></td>
			</tr>
			<tr>
				<td style="text-align:right;border-right:0px;" width="40%">电子保单系统：</td>
				<td style="text-align:left;" width="60%" colspan="2">&nbsp;&nbsp;<input type="text" id="editEpolicySystem" class="input_text" onkeyup='clearNoNumber(this)' value=""></td>
			</tr>
		</table>
		<div style="height:30px;width: 95%" align="center">
			&nbsp;&nbsp;&nbsp;&nbsp;<input type="button" id="saveBtn" value="保存" onclick="demandEditSave()" class="input_button_1"/>&nbsp;&nbsp;&nbsp;
			<input type="button" value="取消" onclick="closeCurrentDIV('editDemandDiv')" class="input_button_1"/>
		</div>
	</div>
	
	
<!-- 添加成本DIV -->	
	
	  	<div id="addOrUpdateDiv" style="display: none;height: 300px;width: 680px;margin-top: -50px">
  		<div class="table_title_div">
				<table class="table_title" style='width:680px;height: 20px;'>
					<tr>
						<td width="10%"></td>
						<td width="80%" id="interfaceName"></td>
						<td width="10%" align="right"><img src="<%=path %>/images/closedown.gif" alt="关闭"  onclick="closeCurrentDIV('addOrUpdateDiv')"/></td>
					</tr>
				</table>
		</div>
		
		<div id="channelRelatedDiv" style="height: 250px;overflow-y: scroll">
	  		<table id="channelRelatedTable" class="table_02" align="center" style="width: 600px">
	   			<tr>
	   				<td style="width: 600px">
						<div id="channelTranstypeDiv" style="margin:5px auto;width: 500px">
							<table id="costTable" class="table_02" style="width: 500px">
								<thead>
									 <tr>
						                  <th style="width: 430px">系统名称</th>
						                  <th style="width: 300px">成本</th>
						                  <th style="width: 200px">操作</th>
						              </tr>
								</thead>
								<tfoot>
									<tr>
										<td style="padding: 10px"><select id="systemSelect"><option value="">无可选系统类型！</option></select></td>
										<td> <input id="demandCosts" type="text" value=""> </td>
										<td style="padding: 10px"><input class="input_button_1" type="button" id="systemTypeBtn" value="新增"  onClick="saveChannelTranstype()"/></td>
									</tr>
								</tfoot>

							</table>
						</div>
					</td>	
	   			</tr>
		   </table>
	   </div>
  	</div>
	<input type="hidden" id="idHidden" value="" >
	<div id="Loading" style="display:none" align="center">
		<img src="./images/loading.gif" />
	</div>
</body>
</html>